﻿using System.Windows;
using System.Windows.Input;
using JPR.TunelProxy.RequestGenerator.View;
using JPR.TunelProxy.RequestGenerator.ViewModel;

namespace JPR.TunelProxy.RequestGenerator
{
	/// <summary>
	/// Interaction logic for App.xaml
	/// </summary>
	public partial class App : Application
	{
		private MainWindowViewModel _viewModel;

		public App()
		{
			_viewModel = new MainWindowViewModel();
		}

		protected override void OnStartup(StartupEventArgs e)
		{
			base.OnStartup(e);

			var window = new MainWindow();

			_viewModel.RequestClose += delegate
			{
				window.Close();
			};

			window.DataContext = _viewModel;
			window.Show();
		}
	}
}
